# @Data  : 2020/08/13
# @Author: james
# @Description: 统一的业务错误码定义
from enum import Enum


class ErrorCode(Enum):
    """错误码定义： 6位错误码 012345
    0：错误类型
        5=业务类型
        9=系统报错（一般是框架）
    12： 报错的组件
        00-combox
    345： 具体的错误码
    """
    UNKNOWN = '900001'
    EXCEPTION_EMPTY = '900002'
    NOT_SUPPORT_SELECTOR_TYPE = '900003'
    ELEMENT_TYPE_NOT_MATCH = '900004'
    PAGE_NOT_FIND = '900005'
    PROJECT_VARIABLE_PATH_NOT_EXIST = '900006'
    PROJECT_RESOURCE_PATH_NOT_EXIST = '900007'
    SAVE_SCREENSHOT_ERROR = '900008'
    UN_SUPPORT_ELEMENT = '900009'
    PARAM_ERROR = '900010'
    HTTP_TEST_FAILED = '900011'

    BUSINESS_FLOW_ERROR = '500000'
    PORTAL_LOGIN_NOT_ELEMENT = '500001'
    NOT_LOCATE_ELEMENT = '500002'
    ELEMENT_TIME_OUT = '500003'
    ELEMENT_STALE_REFERENCE = '500004'
    ELEMENT_STATE_INVALID = '500005'
    ELEMENT_NO_ATTRIBUTE = '500006'
    ELEMENT_NO_VISIBLE = '500007'
    ELEMENT_NO_INTERACTABLE = '500008'
    ELEMENT_CLICK_INTERCEPTED = '500009'
    ELEMENT_OPERATE_FAILED = '500010'
    VALUE_NOT_FIND = '500011'


    COMBOBOX_VALUE_NOT_EXIST = '501001'

    TABS_VALUE_NOT_EXIST = '502002'

    ALERT_NOT_SUPPORT_BUTTON = '503001'
    ALERT_NOT_SUPPORT_INPUT_TEXT = '503002'
    ALERT_NOT_SUPPORT_CANCEL_BUTTON = '503003'
    ALERT_NOT_FIND = '503004'

    COMBOTREE_NOT_DATA_SOURCE = '504001'
    COMBOTREE_VALUE_NOT_EXIST = '504002'

    GRID_VALUE_NOT_EXIST = '505001'
    GRID_PARAMS_ERROR = '505002'
    GRID_VALUE_NOT_FIND = '505003'
    GRID_COLUMN_LABEL_NOT_FIND = '505004'

    ICHECK_VALUE_NOT_FIND = '506001'

    SWITCH_BUTTON_NOT_SUPPORT_VALUE = '507001'

    TREE_NOT_DATA = '508001'
    TREE_NOT_PARAMS = '508002'
    TREE_VALUE_NOT_FIND = '508003'

    AUTO_COMPLETE_NOT_VALUE = '509001'

    FRAME_NOT_EXIST = '510001'

    DATE_PICKER_SET_FAILED = '511001'

    UPLOAD_FAILED = ' 512001'

